﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SalemanInForInput.aspx.cs" Inherits="UI.ModSalesman.SalemanInForInput" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>搜索工号以输入</title>
   <link rel="stylesheet" type="text/css" href="../Styles/BaseStyle.css"  />
</head>
<body>
    <form id="form1" runat="server">
   <div style="text-align: center">
    <br />
        <asp:TextBox ID="txtSearchWord" runat="server"></asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" Text="搜索" Width="59px" OnClick="btnSearch_Click" /><br />
        <br />
        <br />
        <asp:GridView ID="gvEmployee" runat="server" Width="95%" AllowPaging="True" 
             AutoGenerateColumns="False"  CellPadding="4" ForeColor="#333333" 
             GridLines="None" PageSize="30" DataKeyNames="SaleManID" 
             DataSourceID="EmployeeSDS" onpageindexchanging="gvEmployee_PageIndexChanging">
            <Columns>
             <asp:BoundField DataField="SaleManID" HeaderText="序号" SortExpression="SaleManID" />  
                  <asp:TemplateField HeaderText="部门" SortExpression="DeptName">
                    <ItemTemplate>
                    <a style="cursor:hand" onclick="javascript:aclose('<%# Eval("SaleManID") %>','<%# Eval("EmpCode") %>','<%# Eval("DeptName") %>','<%# Eval("EmpName") %>','<%# Eval("DutyName") %>','<%# Eval("TypeName") %>','<%# Eval("FromCompanyName") %>','<%# Eval("ManageAmount") %>','<%# Eval("SecurityAmount") %>')"><%# Eval("DeptName")%></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="姓名" SortExpression="EmpName">
                    <ItemTemplate>
                    <a style="cursor:hand" onclick="javascript:aclose('<%# Eval("SaleManID") %>','<%# Eval("EmpCode") %>','<%# Eval("DeptName") %>','<%# Eval("EmpName") %>','<%# Eval("DutyName") %>','<%# Eval("TypeName") %>','<%# Eval("FromCompanyName") %>','<%# Eval("ManageAmount") %>','<%# Eval("SecurityAmount") %>')"><%# Eval("EmpName")%></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="EmpSex" HeaderText="性别" SortExpression="Sex" />
                <asp:TemplateField HeaderText="工号" SortExpression="EmpCode">
                    <ItemTemplate>
                       <a style="cursor:hand" onclick="javascript:aclose('<%# Eval("SaleManID") %>','<%# Eval("EmpCode") %>','<%# Eval("DeptName") %>','<%# Eval("EmpName") %>','<%# Eval("DutyName") %>','<%# Eval("TypeName") %>','<%# Eval("FromCompanyName") %>','<%# Eval("ManageAmount") %>','<%# Eval("SecurityAmount") %>')"><%# Eval("EmpCode")%></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="DutyName" HeaderText="品牌" SortExpression="DutyName" />
                <asp:BoundField DataField="TypeName" HeaderText="类型" SortExpression="TypeName" />
                 <asp:BoundField DataField="StateName" HeaderText="状态" SortExpression="StateName" />
                <asp:BoundField DataField="FromCompanyName" HeaderText="单位" SortExpression="FromCompanyName" />
                <asp:BoundField DataField="ManageAmount" HeaderText="管理费" SortExpression="ManageAmount" />
                <asp:BoundField DataField="SecurityAmount" HeaderText="保证金" SortExpression="SecurityAmount" />
            </Columns>
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#E3EAEB" />
            <EditRowStyle BackColor="#7C6F57" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="EmployeeSDS" runat="server" ConnectionString="<%$ ConnectionStrings:JIMConn %>"
            SelectCommand="SELECT [SaleManID],[DeptName], [EmpName], [EmpSex], [EmpCode],[DutyName],[TypeName],[FromCompanyName],[ManageAmount],[SecurityAmount],[StateName] FROM Admin_Salesman   ORDER BY [JoinTime] DESC">
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    function aclose(saleManID,empCode, deptName, empName, dutyName, typeName, fromCompanyName, manageAmount, securityAmount) {
        opener.form1.hidSaleManID.value = saleManID;
        opener.form1.txtEmpCode.value = empCode;
        opener.form1.txtDeptName.value = deptName;

        opener.form1.txtEmpName.value = empName;
        opener.form1.txtDutyName.value = dutyName;

        opener.form1.txtTypeName.value = typeName;
        opener.form1.txtFromCompanyName.value = fromCompanyName;

        opener.form1.txtManageAmount.value = manageAmount;
        opener.form1.txtSecurityAmount.value = securityAmount;
        window.close();
    }
</script>
